package packethandler;

import honor.HonorPublic;
import honor.HonorType;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import platform.Platform;
import player.Player;
import event.ServiceEvent;
import event.ServiceEventListener;

public class HonorEventHandler implements ServiceEventListener
{

	protected static final Logger log = LoggerFactory.getLogger(HonorEventHandler.class);
	
	public HonorEventHandler()
	{
		Platform.getEventManager().registerListener(this);
	}
	
	@Override
	public int[] getEventTypes()
	{
		return new int[] { ServiceEvent.EVENT_GET_HONOR, 
				ServiceEvent.EVENT_GET_TITLE, };
	}

	@Override
	public void handleEvent(ServiceEvent event)
	{
		switch (event.type)
		{
			case ServiceEvent.EVENT_GET_HONOR:
			{
				HonorPublic.SetHonor((HonorType)event.param1, ((Integer)(event.param2)).intValue(), (Player)event.param3);
			}
			break;
			case ServiceEvent.EVENT_GET_TITLE:
			{
				//...
			}
			break;
		}
	}
}
